<!DOCTYPE html>
<html lang="en-US">
  <head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

<!-- Begin Jekyll SEO tag v2.7.1 -->
<title>Search The Scoop Directory | scoop-directory</title>
<meta name="generator" content="Jekyll v3.9.0" />
<meta property="og:title" content="Search The Scoop Directory" />
<meta property="og:locale" content="en_US" />
<meta name="description" content="A directory of buckets for the scoop package manager for Windows" />
<meta property="og:description" content="A directory of buckets for the scoop package manager for Windows" />
<link rel="canonical" href="https://rasa.github.io/scoop-directory/search.html" />
<meta property="og:url" content="https://rasa.github.io/scoop-directory/search.html" />
<meta property="og:site_name" content="scoop-directory" />
<meta name="twitter:card" content="summary" />
<meta property="twitter:title" content="Search The Scoop Directory" />
<script type="application/ld+json">
{"headline":"Search The Scoop Directory","description":"A directory of buckets for the scoop package manager for Windows","url":"https://rasa.github.io/scoop-directory/search.html","@type":"WebSite","@context":"https://schema.org"}</script>
<!-- End Jekyll SEO tag -->

<!-- Minimul theme -->
    <link rel="stylesheet" href="https://rasa.github.io/scoop-directory/assets/css/style.css?v=b57c2f1379ad9a17805766f7e1ca5bf3a1c7b4cc">
    <!--[if lt IE 9]>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv.min.js"></script>
    <![endif]-->
<!-- /Minimul theme -->

<!-- Caymen theme -->
<!--
<link rel="preconnect" href="https://fonts.gstatic.com">
<link rel="preload" href="https://fonts.googleapis.com/css?family=Open+Sans:400,700&amp;display=swap" as="style" type="text/css" crossorigin="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="theme-color" content="#157878">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<link rel="stylesheet" href="/scoop-directory/assets/css/style.css?v=448d7408fa7bab7eca92e646c6d23b853c9aead5">
-->
<!-- /Caymen theme -->

        <!-- start custom head snippets, customize with your own _includes/head-custom.html file -->

<!-- Setup Google Analytics -->

<!-- You can set your favicon here -->
<link rel="shortcut icon" type="image/x-icon" href="/scoop-directory/favicon.ico"/>

<!-- end custom head snippets -->
  <style>
    table td {
      text-align: left;
      display: table-cell;
      vertical-align: top;
    }
    span.leftright {
      display: flex;
      justify-content: space-between;
    }

    span.bottomright {
      position: absolute;
      right: 0;
      bottom: 0;
    }

    .top {
      display: inline-block;
      vertical-align:top;
      width: 100%;
    }
    .bot {
      text-align: right;
      display: inline-block;
      vertical-align:bottom;
      width: 100%;
    }
    .bot:before{
      content: '';
      display: inline-block;
      height: 24px;
    }
  </style>
  </head>
  <body>
    <div class="wrapper">
      <header>
        <h1><a href="/scoop-directory/">scoop-directory</a></h1>



        <p>A directory of buckets for the scoop package manager for Windows</p>


        <p class="view"><a href="https://github.com/rasa/scoop-directory">View the Project on GitHub <small>rasa/scoop-directory</small></a></p>





      </header>
      <section>

      <h1 id="scoop-directory"><a href="https://scoop.sh/">Scoop</a> Directory</h1>

<p><a href="https://github.com/rasa/scoop-directory/actions/workflows/update-index.yml"><img src="https://github.com/rasa/scoop-directory/actions/workflows/update-index.yml/badge.svg" alt="update-index" /></a> <!--
--> <a href="https://ci.appveyor.com/project/rasa/scoop-directory" title="Build Status"><img src="https://ci.appveyor.com/api/projects/status/github/rasa/scoop-directory?svg=true" alt="Build Status" /></a> <!--
--> <a href="https://gitter.im/lukesampson/scoop"><img src="https://badges.gitter.im/lukesampson/scoop.svg" alt="Chat on Gitter" /></a> <!--
--> <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square" alt="Software License" /></a> <!--
--> <a href="https://github.com/h404bi/awesome-scoop/blob/master/README.md" title="Awesome Scoop"><img src="https://awesome.re/mentioned-badge.svg" alt="Mentioned in Awesome Scoop" /></a> </p>

<p>To search, enter an application name, a bucket name, an author name, or repository name:</p>

<input id="searchbox-name" type="text" placeholder="Start typing a keyword" autofocus />
<br/>
<br/>
Results: <select name="rows" id="rows">
  <option value="100">100</option>
  <option value="200">200</option>
  <option value="400">400</option>
  <option value="800">800</option>
  <option value="1600">1600</option>
  <option value="9999">All</option>
</select>
<br/>
<p><em id="metainfotext"></em></p>
<br/>
<table>
  <thead>
    <tr>
      <th style="text-align: left"><span class="leftright"><span>Name</span><span>Version</span></span></th>
      <th style="text-align: left">Description (License)</th>
      <th style="text-align: left">Bucket<br/>Latest version</th>
    </tr>
  </thead>
  <tbody id="searchresults">
  </tbody>
</table>


      </section>
      <footer>

        <p>This project is maintained by <a href="https://github.com/rasa">@rasa</a> and <a href="https://github.com/rashil2000">@rashil2000</a></p>

        <p><small>Hosted on GitHub Pages &mdash; Theme by <a href="https://github.com/orderedlist">orderedlist</a></small></p>
      </footer>
    </div>
    <script src="https://rasa.github.io/scoop-directory/assets/js/scale.fix.js"></script>

    <script src="https://cdnjs.cloudflare.com/ajax/libs/sql.js/1.8.0/sql-wasm.js" integrity="sha512-n7swEtVCvXpQ7KxgpPyp0+DQQEf5vPpmzCRl14x2sp2v5LpCYCjrAx03mkBAbWwGF9eUoIk8YVcDFuJRIeYttg==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
    <script>
      var db, mancount, bukcount;
      var nameInput = document.getElementById('searchbox-name');
      var reqdiv = document.getElementById('searchresults');
      var metainfo = document.getElementById('metainfotext');

      nameInput.addEventListener('input', function (e) {
        var rowsInput = document.getElementById('rows');
        var rows = parseInt(rowsInput.value.trim(), 10)
        if (rows <= 0)
          rows = 100

        const query = nameInput.value.trim().toLowerCase().replace(' ', '%');
        if (query.length >= 2)
          runQuery(query, rows);
        else {
          reqdiv.innerHTML = '';
          metainfo.innerHTML = `Query ${mancount} manifests among ${bukcount} buckets`;
        }
      });

      const runQuery = async (query, rows) => {
        var results = [];

        // See https://stackoverflow.com/a/7313467/1432614
        var ireplace = function(s, strReplace, strWith) {
          // See http://stackoverflow.com/a/3561711/556609
          var esc = strReplace.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
          var reg = new RegExp(esc, 'ig');
          return s.replace(reg, strWith);
        };

        // Specifies the SQL function's name, the number of it's arguments, and the js function to use
        db.create_function("ireplace", ireplace);

        var stmt = db.prepare(`
          SELECT
            ireplace(name, "${query}", "<b>${query}</b>") AS hname,
            version,
            bucket_url,
            ireplace(description, "${query}", "<b>${query}</b>") AS description,
            manifest_url,
            homepage,
            license,
            REPLACE(REPLACE(ireplace(bucket, "${query}", "<b>${query}</b>"), "/", "/&#8203;"), "-", "&#8209;") AS bucket,
            name AS name
          FROM
            apps
          WHERE
            name LIKE "%${query}%" OR
            description LIKE "%${query}%" OR
            bucket LIKE "${query}" OR
            bucket LIKE "${query}%" OR
            bucket LIKE "%/${query}"
          ORDER BY CASE
            WHEN name LIKE "${query}" THEN 1
            WHEN name LIKE "${query}%" THEN 2
            WHEN name LIKE "%${query}" THEN 3
            WHEN name LIKE "%${query}%" THEN 4
            ELSE 5
          END,
          name,
          version DESC
          LIMIT ${rows}
        `);
        while(stmt.step())
          results.push(stmt.getAsObject());
        stmt.free();

        // console.log(results);

        metainfo.innerHTML = `${results.length} result(s)`;
        reqdiv.innerHTML = '';
        for (var i of results)
          reqdiv.insertAdjacentHTML('beforeend', `
            <tr>
              <td style="text-align: left; display: table-cell; vertical-align: top;">
                <span class="leftright">
                  <span><a target="_blank" href="${i.homepage}">${i.hname}</a></span>
                  <span><a target="_blank" href="${i.manifest_url}">
                  ${i.version.split("*").length - 1 === 2
                    ? `<em>${i.version.replaceAll('*', '')}</em>`
                    : i.version}</a>
                  </span>
                </span>
              </td>
              <td style="text-align: left; display: table-cell; vertical-align: top;">${i.description} (<em>${i.license.length < 2 ? `Undefined` : i.license}</em>)</td>
              <td style="text-align: left; display: table-cell; vertical-align: top;"><a target="_blank" href="${i.bucket_url}">${i.bucket}</a></td>
            </tr>
          `);
      };

      (async () => {
        const sqlPromise = initSqlJs({
          locateFile: filename => `https://cdnjs.cloudflare.com/ajax/libs/sql.js/1.8.0/${filename}`
        });
        const dataPromise = fetch("/scoop-directory/scoop_directory.db").then(res => res.arrayBuffer());
        const [SQL, buf] = await Promise.all([sqlPromise, dataPromise])
        db = new SQL.Database(new Uint8Array(buf));

        var cntst = db.prepare(`
          SELECT (
            SELECT COUNT(*) FROM apps
          ) AS appc, (
            SELECT COUNT(*) FROM buckets
          ) AS bukc
        `);
        cntst.step();
        mancount = cntst.getAsObject()['appc'];
        bukcount = cntst.getAsObject()['bukc'];
        cntst.free();
        metainfo.innerHTML = `Query ${mancount} manifests among ${bukcount} buckets`;

        const q = (new URLSearchParams(window.location.search)).get('q');
        if (q && q.trim().length >= 2) {
            nameInput.value = q;
            nameInput.dispatchEvent(new Event("input"));
        }
      })();
    </script>
  </body>
</html>
